package com.alibaba.citrus.cr.platform.enhance.functions.customer;

import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.alibaba.citrus.cr.platform.enhance.repository.CustomerAddressRepository;

import com.epoch.app.crplatformenhance.sdo.CustomerAddressSDO;
import lombok.Getter;
import lombok.Setter;

public class CustomerAddressEntity {

    @Getter
    @Setter
    private CustomerAddressSDO sdo;

    private static CustomerAddressRepository addressRepository;

    static {
        addressRepository = SpringContextUtil.getBean(CustomerAddressRepository.class);
    }

    public static CustomerAddressEntity of(CustomerAddressSDO sdo) {
        CustomerAddressEntity entity = new CustomerAddressEntity();
        entity.setSdo(sdo);
        return entity;
    }

    public Boolean edit() {
        return addressRepository.editAddress(this.sdo);
    }
}
